#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;

void solve(){
    LL x1, y1, x2, y2, x3, y3;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;

    if((x1 == x2 || x1 == x3) && (y1 == y2 || y1 == y3)){
        cout << "NO" << '\n';
    }else if((x2 == x1 || x2 == x3) && (y2 == y1 || y2 == y3)){
        cout << "NO" << '\n';
    }else if((x3 == x1 || x3 == x2) && (y3 == y1 || y3 == y2)){
        cout << "NO" << '\n';
    }else{
        cout << "YES" << '\n';
    }
}

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;
    while(T--){
        solve();
    }


    return 0;
}